# _*_ coding: utf-8 _*_
from odoo import models, fields, api


class PurchaseRequisition(models.Model):
    _inherit = "purchase.requisition"

    cancel_reason = fields.Text(string="Cancel Reason")

    def action_cancel_with_reason(self):
        self.ensure_one()
        action = self.env.ref("tuntex_DIS029_purchase_requisition_cancel_reason.purchase_requisition_cancel_action")
        if not action:
            return True
        action_dict = action.read()[0]
        return action_dict
